<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<script type="text/javascript" charset="gbk">
window.UEDITOR_HOME_URL = "/mcstu/ueditor/";//编辑器项目路径
	</script>
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/editor_config.js"></script>
<script type="text/javascript" charset="utf-8"
		src="<%=basePath%>ueditor/editor_all.js"></script> 
<div id='message'>
   <c:if test="${message }">
         <div style='height:70px;background-color: #eee;'>
           <table class='table' style='width:100%;'>
          <tr>
             <td align="center">
               <strong style='color: #990000;font-size: 14px;'> 
                <b> ${user.realName }</b>  	,   添加教师成功，你可以继续添加！</strong>
             </td>
          </tr> 
         </table>
         </div>
   </c:if>
</div>
<form action="<%=basePath %>backend/addteacher" method="post" id='teacherForm'>
			<div class="row" style='margin-top:10px;'>
              <div class="col-sm-6 input-group">
                 <span class="input-group-addon">专		业</span>
                  <select class="form-control" id='major' name='major1'>
                  <option value='0'>---请选择---</option>
                  <c:forEach items="${ majors}" var="major">
                     <option value="${major.id }">${major.name }</option>
                  </c:forEach>
                  </select>
             
               </div>
               
               <!-- Optional: clear the XS cols if their content doesn't match in height -->
               <div class="clearfix visible-xs"></div>
              
           </div>
           <div class='row'>
             <div class="col-md-6 input-group" style='margin-top:10px;'>
                 <span class="input-group-addon">类		型</span>
                   <c:forEach items="${teachertypes }" var="teachertype1">
                         <div class='span5'>
                            <input class='checkbox' name='${teachertype1.tName }' value='${teachertype1.id }' type="checkbox">${teachertype1.tName }
                         </div>
                   </c:forEach>
               
               </div>
           </div>
           <div class="row" style='margin-top:10px;'>
              <div class="col-sm-6 input-group">
                 <span class="input-group-addon">教师姓名</span>
                  <input class="form-control " style='height:30px;' name="name" type="text" />
               </div>
               <div class="col-sm-6 input-group">
                  <span class="input-group-addon">教师编号</span>
                  <input class="form-control " style='height:30px;' name="no" type="text" />
               </div>
               <!-- Optional: clear the XS cols if their content doesn't match in height -->
               <div class="clearfix visible-xs"></div>
              
           </div>  
           <div class="row" style='margin-top:10px;'>
              <div class="col-sm-6 input-group">
                 <span class="input-group-addon">电		话</span>
                  <input class="form-control " style='height:30px;' name="phone" type="text" />
               </div>
               <div class="col-sm-6 input-group">
                 <span class="input-group-addon">Q		Q</span>
                  <input class="form-control " style='height:30px;' name="qq" type="text" />
               </div>
                 
               <!-- Optional: clear the XS cols if their content doesn't match in height -->
               <div class="clearfix visible-xs"></div>
              
           </div> 
           <div class='row' style='margin-top:10px;'>
             <div class=" col-md-6 control-group">
		             <span class="input-group-addon" for="">性		别</span>
		             
		             
			           
			              <input class="form-control" type="radio" name="gender" value="男"> 男
			            
			             
			               <input class="form-control" type="radio" name="gender" value="女"> 女
			             
		          
               </div>
           </div>
			  <div style='margin-top: 10px;'>
			  <strong>教师简介</strong><br><br>
		       <script  id="editor" ></script>
		       </div>
	
		<input type="submit" value="完成" style="margin-left: 700px;margin-top: 10px;" class="btn btn-info" onclick="return getContent();"/></div>
		<input id="content1" type="hidden" name="introduce">
		<input id='belong1' type="hidden" name='belong' />
		<!-- <input id='belong' name='belong' type="hidden" > -->
	</form>
	
	<script type="text/javascript">
	var ue = UE.getEditor('editor');
    function getContent() {
        var str= ue.getContent();
        $("#content1").val(str);
        var str="";
        var result = 0;
        $(".checkbox").each(function(){
        	if($(this).attr("checked") == true || $(this).attr("checked") == "checked")
			  {
       		      result =parseInt(result)+ parseInt($(this).val());
			  }
        });
      //  alert(result);
        $("#belong1").val(result);
       // result = 0;
        return true;
    }
</script>
